import java.util.Scanner;
public class Text {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Divistring distr = new Divistring();
        StringBuilder str = new StringBuilder();
        distr.diviseString(str.append(sc.nextLine()),sc.nextInt());

    }
}
